home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
tpbind.zip
/
LDB2.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-05-22
|
1KB
|
54 lines
program ldb2;
uses bind;
type strPtr = ^string;
const
s1 : string = 'Now is the time';
s2 : string = 'for all programmers';
s3 : string = 'to stop reinventing';
s4 : string = 'the linked list';
s5 : string = 'and container classes.';
function strcmp(D1, D2 : pointer) : integer; far;
begin
if (strPtr(D1)^ < strPtr(D2)^) then
strcmp := -1
else if (strPtr(D1)^ > strPtr(D2)^) then
strcmp := 1
else
strcmp := 0
end;
var B : Binder;
i : word;
begin
B.Init;
B.setDelta(1);
B.setLimit(3);
B.setMaxNodes(3);
B.push(@s1);
B.insq(@s2);
B.atIns(B.getNodes,@s3);
B.insq(@s4);
B.insq(@s5);
while (B.next) do
writeln(strPtr(B.current)^);
B.setComparE(strcmp);
if (B.findFirst(@s3) <> BNOTFOUND) then
writeln(strPtr(B.current)^);
B.Done;
readln
end.